from PyQt5.Qt import *
import sys
class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("")
        self.resize(600,400)
        led1 = QLineEdit(self)
        led1.move(50,100)
        led1.resize(300,36)
        led2 = QLineEdit(self)
        led2.move(50, 150)
        led2.resize(300, 36)
        led3 = QLineEdit(self)
        led3.move(50, 200)
        led3.resize(300, 36)
        '''
        1.setFocus() 设置焦点
        2.clearFocus() 清空焦点
        3.setFocusPolicy() 设置用哪种方式获得焦点
            TabFocus : 只能使用Tab键才能获取焦点
            ClickFocus: 只能使用鼠标点击才能获取焦点
            StrongFocus:上面两种都行
            NoFocus ：上面两种都不行
        '''
        led2.setFocus()
        led2.clearFocus()
        led2.setFocusPolicy(Qt.NoFocus)
        led2.setFocus()



if __name__=='__main__':
    app = QApplication(sys.argv)
    w = Window()
    w.show()
    sys.exit(app.exec_())